#ifndef _CTRLTHREAD_H
#define _CTRLTHREAD_H

#include <QThread>
#include "../define.h"

class CtrlThread : public QThread
{
	Q_OBJECT

public:
	// TODO:应该是在cpyProgramToShm()时对program_s中的meas_type赋值
//	void setMeasType(meas_type_enum type) { measType = type;}
	void setManual() { manualPressed = true; }

	bool getMeasStatus() { return measStatus; }
	void setMeasStatus(bool status) { measStatus = status; }

	void emitMeasDataReadySignal();

	int scanbuttons(int * pckey);
	int waitManual();

signals:
	void measDataReady();
protected:
	void run();
private:
	volatile bool manualPressed;
//	meas_type_enum measType;
	volatile bool measStatus;
};

#endif //_CTRLTHREAD_H
